package com.thti.mecool.client.adapter;

import java.util.List;
import java.util.Map;

import com.thti.mecool.client.activity.R;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class WorkMemoRemindAdapter extends BaseAdapter {
	List<Map<String,String>> list;
	Context mContext;
	
	public WorkMemoRemindAdapter(List<Map<String, String>> list,
			Context mContext) {
		super();
		this.list = list;
		this.mContext = mContext;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		View view =((Activity) mContext).getLayoutInflater().inflate(R.layout.mecool_workmemo_remind_list_item,null);
		TextView time,content;
		try {
			time=(TextView)view.findViewById(R.id.mecool_workmemo_remind_list_item_time);
			content=(TextView)view.findViewById(R.id.mecool_workmemo_remind_list_item_content);
			view.setTag(position);
			time.setText(list.get(position).get("showtime"));
			content.setText(list.get(position).get("showcontent"));
		} catch (Exception e) { 
			// TODO: handle exception
		}
		return view;
	}

}
